﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MINERP.DAL.CommonDAL
{
    public class TB_OrderBagDAL:DALBase
    {
        public static Tb_OrderBag GetOneById(int orderBagId)
        {
            return DataEntites.Tb_OrderBag.FirstOrDefault(ob => ob.OrderBagId == orderBagId);
        }

        /// <summary>
        /// 获取产品的价格
        /// </summary>
        /// <param name="productId"></param>
        /// <returns></returns>
        public static double GetProductPrice(int productId)
        {
            try
            {
                orderInfo info = DataEntites.orderInfo.Where(p => p.OrderProductId == productId).First();
                return Convert.ToDouble(info.PrePriceCount);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
